package com.china.produce.config.shiro.filters;

import com.alibaba.fastjson.JSONObject;
import org.apache.shiro.web.filter.authc.UserFilter;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;

/**
 * @ClassName
 * @Author niujie
 * @Version
 * @Description
 * @CreateTime 2022/5/1
 */
public class LoginFilter extends UserFilter {


    protected void redirectToLogin(ServletRequest request, ServletResponse response) throws IOException {
        response.setContentType("application/json; charset=utf-8");
        // 自定义返回内容
        response.getWriter().write(JSONObject.toJSONString("失败！！"));
    }
}
